public class Array {
    public static void main(String[] args) {
        int i = 0;
        String s1 = "Hello, my name is John";
        String[] str = s1.split(" ");
        for(i = 0;i < str.length;i++){
            System.out.println(str[i]);
        }
        System.out.println(i);
    }
}
